<template>
  <div class="dengdai">
    <div v-for="item in lists"
         :key="item.help_id"
         class="jiulist">
      <img :src="item.image"
           alt="">
      <div class="xiang">
        <p>
          <span class="title">领养时间：</span>
          <span>{{item.adopt_time}}</span>
        </p>
        <p>
          <span class="title">领养人姓名：</span>
          <span>{{item.true_name}}</span>
        </p>
        <p>
          <span class="title">联系方式：</span>
          <span>{{item.phone}}</span>
        </p>

        <p>
          <span class="title">领养人地址：</span>
          <span>{{item.address}}</span>
        </p>
        <p>
          <span class="title">宠物名字：</span>
          <span>{{item.petname}}</span>
        </p>
        <p>
          <span class="title">审核状态：</span>
          <span>{{item.status}}</span>
        </p>
      </div>
    </div>
  </div>
</template>



<script>
import { onMounted, ref } from 'vue'
import axios from '@/axios'
export default {
  components: {},
  setup() {
    let lists = ref([])
    let hello = ref('hello')
    const username = localStorage.getItem('username')
    onMounted(() => {
      //获取审核列表
      axios
        .get('/shenhe', { username: username })
        .then((d) => {
          console.log(d)
          //过滤数据
          lists.value = d.filter((item) => {
            return item.status === '待审核' || item.adopt_status === '待领养'
          })

          // console.log(lists.value)
        })
        .catch((err) => console.log(err))
    })

    return {
      hello,
      lists
    }
  }
}
</script>

<style scoped lang="less">
.dengdai {
  width: 1000px;
  margin: 0 auto;
  .jiulist {
    display: flex;
    margin: 20px 0;
    border: 2px solid #ccc;
    img {
      width: 500px;
      height: 250px;
    }
    .xiang {
      padding: 10px 30px;
      p {
        margin: 5px 0;
        display: flex;
        align-items: center;
        font-size: 16px;
        font-weight: 400;
        .title {
          font-size: 18px;
          font-weight: 500;
          margin-right: 10px;
        }
        .beizhu {
          display: inline-block;
          width: 300px;
          white-space: nowrap; /* 禁止换行 */
          overflow: hidden; /* 隐藏超出部分 */
          text-overflow: ellipsis;
        }
      }
    }
  }
}
</style>

